const path = require('path');
const config = require('./src/settings')

module.exports = {
    publicPath: '/',
    outputDir: 'dist',
    productionSourceMap: true,
    parallel: require('os').cpus().length > 1,
    pwa: {},
    chainWebpack: () => {},
    configureWebpack: {
        name: config.name,
        resolve: {
            alias: {
                '@': path.join(__dirname, 'src')
            }
        }
    },
    devServer: {
        open: false,
        host: '0.0.0.0',
        port: 80,
        https: false,
        hotOnly: false,
        proxy: {
            '/api': {
                target: 'http://127.0.0.1:10010',
                ws: false,
                changeOrigin: true,
                pathRewrite: {
                    '^/api': '/'
                }
            }
        },
        before: app => {}
    },
    css: {
        extract: true,
        sourceMap: false,
        loaderOptions: {},
        modules: false
    },
    pluginOptions: {}
}